import axios from './api' // 倒入 api
import config from './config.js' // 倒入默认配置
export const BASEURL = config.baseURL

/* 将所有接口统一起来便于维护
 * 如果项目很大可以将 url 独立成文件，接口分成不同的模块
 */

// 医院管理-获取所有医院（不分页）
export const GETHOSPITALOPTIONS = (params) => {
  return axios({
    url: 'hospital/options',
    method: 'GET',
    params,
  })
}

// 医院管理-获取所有医院（筛选过的）
export const GETHOSPITALOPTIONSFORORDER = (params) => {
  return axios({
    url: 'hospital/optionsForOrder',
    method: 'GET',
    params,
  })
}

// 医院管理-获取医院（分页）
export const GETHOSPITALSEARCH = (params) => {
  return axios({
    url: 'hospital/search',
    method: 'GET',
    params,
  })
}
// 医院管理-新增医院
export const ADDHOSPITALINFO = (params) => {
  return axios({
    url: 'hospital/add',
    method: 'POST',
    data: params,
  })
}

// 医院管理-编辑医院
export const EDITHOSPITALINFO = (params) => {
  return axios({
    url: 'hospital/edit',
    method: 'POST',
    data: params,
  })
}

// 医院管理-查看医院详情
export const GETHOSPITALINFO = (params) => {
  return axios({
    url: 'hospital/info',
    method: 'GET',
    params,
  })
}

// 医院管理-删除医院
export const DELETEHOSPITALINFO = (params) => {
  return axios({
    url: 'hospital/delete',
    method: 'GET',
    params,
  })
}

// 医院概览-医院成交情况
export const GETHOSPITALDEALCHART = (params) => {
  return axios({
    url: 'overview/hospital/dealChart',
    method: 'GET',
    params,
  })
}

// 医院概览-到店率异常情况
export const GETARRIVALRATEABNORMALSEARCH = (params) => {
  return axios({
    url: 'overview/hospital/arrivalRateAbnormalSearch',
    method: 'GET',
    params,
  })
}

// 医院概览-医院预约情况
export const GETAPPOINTMENTCHART = (params) => {
  return axios({
    url: 'overview/hospital/appointmentChart',
    method: 'GET',
    params,
  })
}

// 医院概览-医院转化率情况
export const GETCONVERSIONCHART = (params) => {
  return axios({
    url: 'overview/hospital/conversionChart',
    method: 'GET',
    params,
  })
}

// 医院概览-每个到店客户平均产值
export const GETOUTPUTVALUECHART = (params) => {
  return axios({
    url: 'overview/hospital/outputValueChart',
    method: 'GET',
    params,
  })
}

// 医院概览-客户投诉列表
export const GETCUSTOMERCOMPLAINTSEARCH = (params) => {
  return axios({
    url: 'overview/hospital/customerComplaintSearch',
    method: 'GET',
    params,
  })
}

// 医院-医院信息-数据分析-获取累计数据
export const GETHOSPITALCUMULATIVE = (params) => {
  return axios({
    url: 'hospital/data/cumulative',
    method: 'GET',
    params,
  })
}

// 医院-医院信息-数据分析-近三个月成交情况
export const GETHOSPITALDEALLASTTHREEMONTH = (params) => {
  return axios({
    url: 'hospital/data/dealLast3Month',
    method: 'GET',
    params,
  })
}

// 医院-医院信息-数据分析-成交客单价分布
export const GETHOSPITALDEALCUSTOMERUNITPRICE = (params) => {
  return axios({
    url: 'hospital/data/distribution/dealCustomerUnitPrice',
    method: 'GET',
    params,
  })
}

// 医院-医院信息-数据分析-业务分析图表
export const GETHOSPITALBUSINESSANALYSISCHART = (params) => {
  return axios({
    url: 'hospital/data/businessAnalysisChart',
    method: 'GET',
    params,
  })
}

// 医院-医院信息-数据分析-业务分析
export const GETHOSPITALBUSINESSANALYSIS = (params) => {
  return axios({
    url: 'hospital/data/businessAnalysis',
    method: 'GET',
    params,
  })
}

// 医院-医院信息-数据分析-项目分布
export const GETHOSPITALDEALPROJECT = (params) => {
  return axios({
    url: 'hospital/data/distribution/dealProject',
    method: 'GET',
    params,
  })
}

// 医院-医院信息-数据分析-年龄分布
export const GETHOSPITALDEALAGE = (params) => {
  return axios({
    url: 'hospital/data/distribution/dealAge',
    method: 'GET',
    params,
  })
}

// 概览-医院概览-主诉成交异常
export const GETMAINDEMANDSRATEABNORMALSEARCH = (params) => {
  return axios({
    url: 'overview/hospital/mainDemandsRateAbnormalSearch',
    method: 'GET',
    params,
  })
}

// 概览-医院概览-产值异常
export const GETARRIVALOUTPUTVALUEABNORMALSEARCH = (params) => {
  return axios({
    url: 'overview/hospital/arrivalOutputValueAbnormalSearch',
    method: 'GET',
    params,
  })
}

// 医院-账号管理-获取列表
export const GET_HOSPITAL_ACCOUNTLIST = (params) => {
  return axios({
    url: 'hospital/account/search',
    method: 'GET',
    params,
  })
}

// 医院-日志管理-获取列表
export const GET_HOSPITAL_LOGGINLIST = (params) => {
  return axios({
    url: 'hospital/loggin/search',
    method: 'GET',
    params,
  })
}

// 医院-所有医院-获取列表
export const GET_HOSPITAL_SEARCHALL = (params) => {
  return axios({
    url: 'hospital/searchAll',
    method: 'GET',
    params,
  })
}

// 医院-所有医院-获取下拉列表
export const GET_HOSPITAL_OPTIONS = (params) => {
  return axios({
    url: 'hospital/options',
    method: 'GET',
    params,
  })
}

// 医院-所有医院-修改排序时间
export const UPDATE_HOSPITAL_ORDERTIME = (params) => {
  return axios({
    url: 'hospital/modifyOrderTime',
    method: 'POST',
    data: params,
  })
}

// 医院-所有医院-导出excel
export const EXPORT_HOSPITAL_LIST = BASEURL + 'hospital/export'